package basicShapes;

import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import image.Image;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "upperLeftCornerX",
    "upperLeftCornerY",
    "height",
    "width"
})
@XmlRootElement
public class Ellipse extends Image {

	@XmlAttribute
	protected int upperLeftCornerX;
	@XmlAttribute
	protected int upperLeftCornerY;
	@XmlAttribute
	protected double height;
	@XmlAttribute
	protected double width;
	
	public Ellipse() {
		
	}
	
	public Ellipse(int upperLeftCornerX,
					int upperLeftCornerY,
					double width,
					double height){
		
		this.upperLeftCornerX = upperLeftCornerX;
		this.upperLeftCornerY =upperLeftCornerY;
		this.width = width;
		this.height = height;
	}
	
	public void draw( Graphics2D g){
		g.draw(new Ellipse2D.Double(upperLeftCornerX, upperLeftCornerY, width, height));
	}
	public String toString(){
		return "Ellipse - x:"+this.upperLeftCornerX
						+" y:"+this.upperLeftCornerY
						+" width: "+this.width
						+" height: "+this.height;
	}
}
